import request from '@/utils/request'

// 获得收货地址列表
export const getAddress = () => {
  return request.get('/address/list')
}

// 添加地址
// BUG: The interface name should be add
export const addAddress = (name, phone, value, label) => {
  return request.post('/address/list', {
    form: {
      name,
      phone,
      region: {
        value,
        label
      }
    }
  })
}

// 获取收货地址详情
export const getAddressDetail = (addressId) => {
  return request.get('/address/detail', {
    params: {
      addressId
    }
  })
}